import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
//引入组件
import User from'@/page/user/index.vue'
import Login from'@/page/Login/Login.vue'
import Admin from '@/page/admin.vue'
import StudentAdd from '@/page/admin/studentAdd/index.vue'
import Studentlist from '@/page/admin/studentlist/index.vue'
import LoginLog from '@/page/admin/loginlog/index.vue'
import AdminInfo from '@/page/admin/adminInfo/index.vue'
import SetTime from '@/page/admin/setTime/index.vue'
import DaiQian from '@/page/admin/daiqian/index.vue'
//配置路由
export default new Router({
    routes:[
        {
            path: '/',
            redirect: '/login' // 将根路由重定向到登录页面
        },
        {
            path: '/admin',
            redirect: '/studentlist' // 将根路由重定向到登录页面
        },
    
        {
            path: '/user/',
            name:'user',
            component:User,
        },
        {
            path:'/login',
            component:Login
        },
        {
            path:'/admin',
            component:Admin,
            children:[
                {
                    path:'/studentAdd',
                    component:StudentAdd,
                },
                {
                    path:'/studentlist',
                    component:Studentlist,
                },
                {
                    path:'/loginlog',
                    component:LoginLog
                },
                 {
                    path:'/admininfo',
                    component:AdminInfo
                },
                {
                    path:'/setTime',
                    component:SetTime
                },
                {
                    path:'/daiqian',
                    component:DaiQian
                }
            ]
        },
    ]
})